﻿@page "/system_tool/code_generration"
<div>
    <Steps Current="current">
        <Step Title="实体" Subtitle="选择要生成代码的实体" />
        <Step Title="配置" Subtitle="自定义配置" />
        <Step Title="结果" Subtitle="代码生成结果"/>
    </Steps>
    <div style="margin-top:20px;">
        @if (current == 0)
        {
            <Table Loading="entityDefinitionsLoading"
                   DataSource="@entityDefinitions"
                   Bordered=@true
                   Size=@TableSize.Small
                   PageSize="entityDefinitions.Count"
                   HidePagination=true
                   ScrollY="500px"
                   @bind-SelectedRows="selectedEntityDefinitions">
                <Selection Key="@(context.FullName)" Type="radio" />
                <Column @bind-Field="@context.Name"></Column>
                <Column @bind-Field="@context.Description"></Column>
            </Table>
        }
        else if (current == 1) 
        {
            <Form Model="@selectEntityCodeGenerationSettingDto"
                  LabelCol="new ColLayoutParam { Span = 8 }"
                  WrapperCol="new ColLayoutParam { Span = 16 }">
                <FormItem>
                    <Input @bind-Value="@context.ControllerGroup" />
                </FormItem>
                <FormItem>
                    <Input @bind-Value="@context.ControllerRoute" />
                </FormItem>
                <FormItem>
                    <Input @bind-Value="@context.ModuleName" />
                </FormItem>
            </Form>
        
        }
    </div>
    <Row Style="margin-top:20px;">
        <Col Span="8"></Col>
        <Col Span="8" Style="text-align:center;">
        @if (current > 0)
        {
            <Button Type="primary" OnClick="OnPreClick">上一步</Button>
        }
        @if (current < 2)
        {
            <Button Type="primary" OnClick="OnNextClick">下一步</Button>
        }
        
        </Col>
        <Col Span="8"></Col>
    </Row>
</div>

<style>
    .steps-content {
        margin-top: 16px;
        border: 1px dashed #e9e9e9;
        border-radius: 6px;
        background-color: #fafafa;
        min-height: 200px;
        text-align: center;
        padding-top: 80px;
    }
</style>
